package com.crois.barrier.admin.entity;

import lombok.Data;

/**
 * @author Hou Ze Yu
 * @description 服务端信息
 * @date 2020/10/23
 */
@Data
public class BarrierServer {

   private String serverName;
    /**
     * ip
     */
   private String ip;
    /**
     * port
     */
   private int port;
    /***
     * last beat
     */
    private volatile long lastBeat = System.currentTimeMillis();

    /**
     * instance health status
     */
    private boolean healthy = true;


    private float load;

    private float cpu;

    private float mem;


    /**
     * If instance is enabled to accept request
     */
    private boolean enabled = true;

    public String getAddressKey(){
        return ip+":"+port;
    }
}
